import Router from 'vue-router'
import { Component, Emit, Inject, Model, Prop, Provide, Vue, Watch } from 'vue-property-decorator'
import TcCardList from '@/controls/TcCardList.vue'
import TcTabs from '@/controls/TcTabs.vue'
import Http from '../../../components/http'

@Component({
  components: {
    TcTabs,
    TcCardList
  }
})
export default class ViewPage extends Vue {
  newsList = []

  tabs = [
    { name: '观点', url: '/information/view/viewnews' },
    { name: '要闻', url: '/information/view/majornews' },
    { name: '快讯', url: '/information/view/fastnews' }
  ]

  mounted () {
    Http.get(Http.Urls.getNewsList).then(function (list) {
      this.newsList = list
    }.bind(this))
  }

  newsClick (index) {
    this.$router.push('/view/' + index)
  }
}
